<tagLib name="preem" />
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
	<head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <title><preem:category id=".id" field="fullname"/>&nbsp;&nbsp;{&site_name}</title>
        <link rel="stylesheet" type="text/css" href="__TMPL__reset.css"/>
        <link rel="stylesheet" type="text/css" href="{$TplPath}/css/index.css"/>
        <link rel="stylesheet" type="text/css" href="{$TplPath}/css/view.css"/>
        <script type="text/javascript" src="__TMPL__v.js"></script>
		<script type="text/javascript">
            DD_roundies.addRule('.rounded', '8px', true);
			DD_roundies.addRule('#commands', '0 0 8px 8px', true);
           // DD_roundies.addRule('.roundedHalf', '8px 8px 0 0', true);
        </script>
        <style type="text/css">
            .bigtype{
                padding:10px 0;
            }
            .bigname{
                font-size:14px;
                font-weight:bold;
                letter-spacing:2px;
            }
            .bigtype div{
                margin:10px 0;
            }
            .tlist li{
                float:left;
                width:160px;
                height:20px;
                line-height:20px;
                padding:4px 10px;
            }
            .tlist a{
                font-size:13px;
                padding:2px;
            }
            .tlist a:hover{
                background-color:#0066CC;
                color:#fff;
            }
        </style>
	</head>
	<body>
        <div id="container" class="clearfix">
            {:get_var('Head_Main')}
            <div id="content" class="rounded clearfix">
			    <div class="rounded arctitle">
                    <h5>机械工程及自动化学院教学、科研、实验人员组成情况</h5>
                </div>
                <div class="arcconts">
                    <?php
                    $dao=new CategoryModel();
                    $parentCategoryId=25;   //教师简介的栏目ID
                    $subCates=$dao->field('id,typename')->where('pid='.$parentCategoryId)->order('id')->findAll();
                    
                    $ids=array();
                    $cates=array();
                    foreach($subCates as $key=>$val){
                        $cates['p'.$val['id']]=$val;
                        $cates['p'.$val['id']]['arclist']=array();
                        $ids[]=$val['id'];
                    }

                    //查询这些栏目下的文章
                    $dao=new ArchiveModel();
                    $list=$dao->field('id,title,category')->order('category,title')->where("category in (".implode(',',$ids).")")->findAll();

                    foreach($list as $row){
                        $cates['p'.$row['category']]['arclist'][]=$row;
                    }

                    echo "<table><tbody>";
                    foreach($cates as $row){
                        echo '<tr><td class="bigtype">';
                        echo '<p class="bigname">'.$row['typename'].'</p><div>';
                        $arclist=$row['arclist'];
                        if(count($arclist)>0){
                            echo '<ul class="tlist">';
                            foreach($arclist as $arc){
                                echo '<li><a href="__URL__/teacher/id/'.$arc['id'].'">'.$arc['title'].'</a></li>';
                            }
                            echo '</ul></div>';
                        }
                        echo '</td></tr>';
                    }
                     echo "</tbody></table>";
                    ?>
                </div>
            </div>
           <div id="copyright">
                <p><b>{&site_name}</b><b>版权所有</b><b><a target="_blank" href="__APP__/Public/login">网站管理</a></b></p>
                <p>copyright&copy;2009,school of Mechanical Engineering and Automation,All Rights Reserved</p>
            </div>
        </div>
	</body>
</html>